﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace SnakeInitial
{
    public partial class Form2 : Form
    {
        public Form2(string values)
        {
            InitializeComponent();
            LblWin.Text = values + " Won";
        }
        public Form2()
        {
            InitializeComponent();
        }
        public void th()
        {
            ThreadStart ts = new ThreadStart(work);
            Thread th = new Thread(ts);
            th.Start();
        }
        public void work()
        {
            string developer = "Developed by Gowtham.S(Student from NIIT Nungambakkam, INDIA)";
            string SOM = "Source Of Motivation: Mr.Kunal Subhankar";
            for (int i = 0; i < developer.Length; i++)
            {
                label2.Invoke(new MethodInvoker(() => label2.Text += Convert.ToString(developer[i])));
                Thread.Sleep(45);
            }
            label3.Invoke(new MethodInvoker(() => label3.Text += Convert.ToString(SOM)));
        }
        private void Form2_Load(object sender, EventArgs e)
        {
            th();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void button2_Click(object sender, EventArgs e)
        {          
            this.Close();
        }
    }
}
